<template>
  <div class="maingoods">
      <ul>
        <li v-for="(item) in item" :key="item.goods_id" @click="goGoodDetail(item.goods_id)">
          <img :src="item.goods_image" alt="">
          <div class="goodtitle">
            <div class="title">{{ item.goods_name }}</div>
            <i>￥</i><span>{{ item.line_price_max }}</span>
            <span class="price">&nbsp;&nbsp;已售{{ item.goods_sales }}</span>
          </div>
        </li>

      </ul>
    </div>
</template>

<script>

export default {
  props: {
    item: Array
  },
  data () {
    return {

    }
  },
  methods: {
    goGoodDetail (id) {
      this.$router.push({
        path: '/prodetail',
        query: {
          id: id
        }
      })
    }
  }
}
</script>

<style>
.maingoods ul li{
  float: left;
  width: 180px;
  height: 220px;
  margin-left: 4px;
  margin-bottom: 4px;
  border-radius: 5px;

}
.maingoods ul li img{
  width: 100%;
  height: 170px;
  border-radius: 5px;
}
.maingoods ul .goodtitle{

  padding: 3px 5px;
}
.maingoods ul .title{
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.maingoods ul .goodtitle i{
  color: red;
  font-size: 11px;
}
.maingoods ul .goodtitle span{
  color: red;
}
.maingoods ul .goodtitle .price{
  color: rgb(205, 203, 203);
  font-size: 12px;
}
</style>
